﻿@model IEnumerable<Project5.Models.SurveyModel>
@{
    ViewBag.Title = "Home Page";
}
           
<script type="text/javascript" src="@Url.Content("~/Scripts/home.js")"></script>

<a class="btn btn-small btn-success" href="@Url.Content("~/Survey/Create")" id="create"><i class="icon-white icon-plus"></i> Create a Survey</a>
<div>&nbsp;</div>
<div id="under_work_table">
    <h5><u>Under Work Surveys</u></h5>
</div>

<div id="active_table">
    <h5><u>Active Surveys</u></h5>
</div>

<div id="inactive_table">
    <h5><u>Inactive Surveys</u></h5>
</div>


<div id="view_table">
    <h5><u>Viewable Surveys</u></h5>
</div>


<div id="deleteModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3 id="deleteModalLabel">Delete</h3>
    </div>
    <div class="modal-body">
        <p>Are you sure you want to delete this survey?</p>
    </div>
    <div class="modal-footer">
        <button class="btn btn-danger" data-dismiss="modal" id="delete">Delete</button>
        <button class="btn" data-dismiss="modal">Cancel</button>
    </div>
</div>

<div id="actionModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="actionModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3 id="actionModalLabel">Action</h3>
    </div>
    <div class="modal-body">
        <p>Are you sure you want to action this survey? It cannot be undone.</p>
    </div>
    <div class="modal-footer">
        <button class="btn btn-success" data-dismiss="modal" id="actionConfirm">Action</button>
        <button class="btn" data-dismiss="modal">Cancel</button>
    </div>
</div>

<script type="text/javascript">    init();</script>

@if (Model != null)
{
    foreach (var item in Model)
    {
      <script type="text/javascript">addTableEntry(@item.State, "@item.Name", "@item.Originator", "@item.createDate", @item.Id, @item.View, "@HttpContext.Current.User.Identity.Name")</script>
    }
}
